package com.tongji.seller.command
{
	/**
	 * 
	 * @author Assassin
	 * 2011-12-14
	 */
	
	import com.tongji.seller.events.DelStoreSceneEvent;
	import com.tongji.seller.model.StoreSceneModel;
	import com.tongji.seller.service.DelStoreSceneService;
	
	import org.robotlegs.mvcs.Command;
	
	
	public class DelStoreSceneCommand extends Command
	{
		[Inject]
		public var event:DelStoreSceneEvent;
		
		[Inject]
		public var service:DelStoreSceneService;
		
		[Inject]
		public var storeSceneModel:StoreSceneModel;
		
		private var sid:int;
		
		override public function execute():void
		{
			switch(event.type)
			{
				case DelStoreSceneEvent.DEL_STORE_FAVORITE:
				{
					service.delStoreFavorite(event.userID, event.sID);
					break;
				}
				case DelStoreSceneEvent.DEL_STORE_USER_SCENE:
				{
					service.delStoreUserScene(event.sID);
					break;
				}
				case DelStoreSceneEvent.DEL_STORE_SYSTEM_SCENE:
				{
					service.delStoreUserSystemScene(event.userID, event.sID);
					sid = event.sID;
					break;
				}
				case DelStoreSceneEvent.DEL_STORE_ITEM:
				{
					service.delStoreItem(event.userID, event.sID);
					break;
				}
				default:
				{
					break;
				}
			}
		}
		
	}
}